package com.hexiang.controller;

import com.hexiang.po.Employee;
import com.hexiang.service.EmployeeService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
public class EmployeeController {

	@Resource
	private EmployeeService employeeService;
	
	@GetMapping("/list")
	public List<Employee> list(){
		return employeeService.findAll();
	}
	
	@GetMapping("/emp/{id}")
	public Employee emp(@PathVariable("id") Integer id){
		return employeeService.selectEmp(id);
	}
	
}
